# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Tarmo Heiskanen <turskii@gmail.com>

pkgname=python-flask
pkgver=2.3.3
pkgrel=1
pkgdesc='Micro webdevelopment framework for Python'
url='http://flask.pocoo.org/'
arch=('any')
license=('custom:BSD')
depends=('python-werkzeug' 'python-jinja' 'python-itsdangerous' 'python-click' 'python-blinker')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-flit-core')
checkdepends=('python-pytest')
optdepends=(
  'python-asgiref: async functions and views'
  'python-dotenv: loading env vars from files'
)
source=("$pkgname-$pkgver.tar.gz::https://github.com/pallets/flask/archive/${pkgver}.tar.gz")
sha512sums=('d4cd9ddbe2fc6155f099bbfb0a135f7bfc7f6061a1c0bad4a6db9d9707814894bcd641237d98889f24e035c02c5a08b667b85b2d0bf6c083049d149292734010')

build() {
  cd "flask-$pkgver"
  python -m build --wheel --no-isolation
}

check() {
  cd "flask-$pkgver"
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest
}

package() {
  cd "flask-$pkgver"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE.rst "$pkgdir/usr/share/licenses/$pkgname/LICENSE.rst"
}

# vim:set ts=2 sw=2 et:
